home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / magazi~1 / 404 / mdraw_it.lst < prev    next >
Encoding:
File List  |  1989-07-02  |  17.5 KB  |  833 lines

  1. '
  2. ' *********************************************************************
  3. '                              D R A W   I T !
  4. '                         A Graphics Design Program
  5. '                            for Young Children
  6. '                    yet another kidprg in GFA Basic from
  7. '                               D.A. Brumleve
  8. '                         Copyright 1989 by ST-LOG
  9. ' **********************************************************************
  10. '                               Monochrome
  11. '                               Version 1.7
  12. '                            February 16, 1989
  13. ' **********************************************************************
  14. '                                REFERENCE
  15. ' **********************************************************************
  16. ' VARIABLES
  17. ' Aa%
  18. ' Alrt$
  19. ' Ax%
  20. ' Ay%
  21. ' Backgrnd%
  22. ' Bb%
  23. ' Brush$--string representing brush mouse
  24. ' Button%
  25. ' C%
  26. ' Cbutton%
  27. ' Cc%--currently-selected color option
  28. ' Clor_choice$--snapshot of the color choices with none selected
  29. ' Crayon$--string representing crayon mouse
  30. ' Current_options$--snapshot of the top row of options with current selections
  31. '                   filled
  32. ' Dd%
  33. ' Drw_type%--type of drawing to be performed:
  34. '            Drw_type%=1...FILL
  35. '            Drw_type%=2...SMALL DOTS
  36. '            Drw_type%=3...MEDIUM-SIZED DOTS
  37. '            Drw_type%=4...LARGE DOTS
  38. ' Dummy%
  39. ' Dur%
  40. ' Filel%
  41. ' Foregrnd%
  42. ' Fstyle%--current fill style
  43. ' Ftype%--current fill pattern type
  44. ' G%
  45. ' Gg%
  46. ' I%
  47. ' Just_drew%--value (0 or 1) indicates whether the last action was performed
  48. '             on the easel and if the mouse button is still down
  49. ' Lx%
  50. ' Main_screen$--snapshot of the main screen
  51. ' Mk%
  52. ' Mx%
  53. ' My%
  54. ' N%
  55. ' Nt%
  56. ' Oct%
  57. ' Old_aa%
  58. ' Old_bb%
  59. ' Oldcc%
  60. ' Old_drw_type%
  61. ' Opt_box$()--snapshot of each of the option boxes without indicator fillings
  62. ' Palette%()
  63. ' Pattern$--snapshot of the FILL option with the currently-selected fill pattern
  64. ' Pg%
  65. ' Pic$()--array containing the five pictures
  66. ' Picn$
  67. ' Rez%
  68. ' Sg%
  69. ' Ss%
  70. ' Stx%
  71. ' Sty%
  72. ' Temporary_pic$--snapshot of the picture prior to the current drawing action
  73. ' Yes%
  74. '
  75. '
  76. ' ***************************** INITIALIZATION *************************
  77. Dim Palette%(1),Pic$(6),Opt_box$(7)
  78. @Check_rez
  79. Gg%=16
  80. Hidem
  81. @Save_palette
  82. Graphmode 2
  83. @Set_color
  84. Cls
  85. @Title
  86. Cls
  87. Drw_type%=2
  88. Cc%=0
  89. @Make_main_screen
  90. Sget Main_screen$
  91. Drw_type%=2
  92. @Determine_draw_option
  93. Temporary_pic$=Pic$(1)
  94. Cc%=0
  95. Old_cc%=0
  96. Deffill 1,2,8
  97. Fill 55,55
  98. Pg%=1
  99. Fstyle%=3
  100. Ftype%=2
  101. Deffill 1,2,8
  102. Pbox 116,62,198,90
  103. Fill 109,1
  104. Deffill Cc%,Ftype%,Fstyle%
  105. Pbox 116,62,198,90
  106. Get 114,60,200,92,Pattern$
  107. Deftext 1,0,0,13
  108. Picn$="PIC "+Str$(Pg%)
  109. Text 442+Gg%+3,28,Picn$
  110. Put 0,112,Pic$(Pg%)
  111. @Make_mouse
  112. @Select_sound
  113. @Let_go
  114. Showm
  115. '
  116. ' **************************** MAIN PROGRAM **************************
  117. Do
  118.   Top:
  119.   Repeat
  120.     Mouse Ax%,Ay%,Button%
  121.     If Button%=0
  122.       Just_drew%=0
  123.     Endif
  124.   Until Button%>0
  125.   Get 0,112,638,398,Pic$(Pg%)
  126.   ' *** option boxes
  127.   If Ay%<116 And Just_drew%=1
  128.     Goto Top
  129.   Endif
  130.   If Ay%>0 And Ay%<44
  131.     ' *** PRINT option
  132.     If Ax%>0 And Ax%<98 And Drw_type%<>1
  133.       @Print_it
  134.       Just_drew%=0
  135.     Endif
  136.     ' *** DRAW option
  137.     If Ax%>108 And Ax%<206
  138.       Put 108,0,Opt_box$(2)
  139.       Deffill 1,2,8
  140.       Fill 109,1
  141.       @Select_sound
  142.       Old_drw_type%=Drw_type%
  143.       @Determine_draw_option
  144.       If Old_drw_type%=1
  145.         @Make_mouse
  146.         Put 108,54,Opt_box$(7)
  147.         Pbox 116,62,198,90
  148.         Put 114,60,Pattern$
  149.       Endif
  150.       Just_drew%=0
  151.     Endif
  152.     ' *** UNDO option
  153.     If Ax%>216 And Ax%<314
  154.       Get 0,0,638,52,Current_options$
  155.       Deffill 1,2,8
  156.       Fill 218,1
  157.       @Select_sound
  158.       Pause 15
  159.       Put 0,112,Temporary_pic$
  160.       Put 0,0,Current_options$
  161.       Just_drew%=0
  162.     Endif
  163.     ' *** BLANK option
  164.     If Ax%>324 And Ax%<422
  165.       Get 0,0,638,52,Current_options$
  166.       Get 0,112,638,398,Temporary_pic$
  167.       Deffill 1,2,8
  168.       Fill 326,1
  169.       @Select_sound
  170.       Pause 15
  171.       Pbox 10,120,628,390
  172.       @Erase_sound
  173.       Put 0,0,Current_options$
  174.       Just_drew%=0
  175.     Endif
  176.     ' *** PIC # option
  177.     If Ax%>432 And Ax%<530
  178.       @Select_sound
  179.       Put 432,0,Opt_box$(5)
  180.       Get 0,0,638,52,Current_options$
  181.       Get 0,112,638,398,Pic$(Pg%)
  182.       Deffill 1,2,8
  183.       Fill 434,1
  184.       Inc Pg%
  185.       If Pg%=6
  186.         Pg%=1
  187.       Endif
  188.       Put 0,112,Pic$(Pg%)
  189.       Temporary_pic$=Pic$(Pg%)
  190.       Put 0,0,Current_options$
  191.       Deftext 1,0,0,13
  192.       Picn$="PIC "+Str$(Pg%)
  193.       Text 445+Gg%,28,Picn$
  194.       Just_drew%=0
  195.     Endif
  196.     ' *** EXIT option
  197.     If Ax%>540 And Ax%<638
  198.       Get 0,0,638,52,Current_options$
  199.       Deffill 1,2,8
  200.       Fill 542,1
  201.       @Select_sound
  202.       Just_drew%=0
  203.       @Save_routine
  204.       If Yes%=1
  205.         Hidem
  206.         Deffill 1,2,8
  207.         Pbox 10,120,628,390
  208.         Deftext 0,0,0,32
  209.         Text 262,260,"B Y E !"
  210.         @Finale_sound
  211.         Cls
  212.         @Restore_palette
  213.         Showm
  214.         End
  215.       Else
  216.         Put 0,0,Current_options$
  217.         Put 0,112,Pic$(Pg%)
  218.       Endif
  219.       @Let_go
  220.     Endif
  221.   Endif
  222.   If Ay%>54 And Ay%<98
  223.     ' *** color choices
  224.     If (Ax%>0 And Ax%<44) Or (Ax%>54 And Ax%<98)
  225.       @New_color
  226.     Endif
  227.     ' *** FILL option
  228.     If Ax%>108 And Ax%<206
  229.       Old_drw_type%=Drw_type%
  230.       Deffill 1,2,8
  231.       Fill 109,55
  232.       Put 108,0,Opt_box$(2)
  233.       Drw_type%=1
  234.       @Drw_icon
  235.       If Cc%=1
  236.         Put 0,54,Clor_choice$
  237.         Cc%=0
  238.         Deffill 1,2,8
  239.         Fill 55,55
  240.         Old_cc%=Cc%
  241.       Endif
  242.       If Old_drw_type%=1
  243.         @Change_fill_pattern
  244.       Else
  245.         @Select_sound
  246.       Endif
  247.       If Old_drw_type%<>1
  248.         @Make_mouse
  249.       Endif
  250.       Get 114,60,200,92,Pattern$
  251.     Endif
  252.     @Let_go
  253.     Just_drew%=0
  254.   Endif
  255.   ' *** easel
  256.   If Ax%>12 And Ax%<626 And Ay%>121 And Ay%<388 And Drw_type%=4
  257.     If Just_drew%=0
  258.       Get 0,112,638,398,Temporary_pic$
  259.     Endif
  260.     @Draw_lines
  261.     Just_drew%=1
  262.     Goto Top
  263.   Endif
  264.   If Ax%>11 And Ax%<627 And Ay%>120 And Ay%<390 And Drw_type%=3
  265.     If Just_drew%=0
  266.       Get 0,112,638,398,Temporary_pic$
  267.     Endif
  268.     @Draw_lines
  269.     Just_drew%=1
  270.     Goto Top
  271.   Endif
  272.   If Ax%>9 And Ax%<629 And Ay%>119 And Ay%<391
  273.     If Just_drew%=0
  274.       Get 0,112,638,398,Temporary_pic$
  275.     Endif
  276.     If Drw_type%=1 And Point(Ax%,Ay%)=1
  277.       Deffill Cc%,Ftype%,Fstyle%
  278.       Fill Ax%,Ay%
  279.     Endif
  280.     If Drw_type%=2
  281.       @Draw_lines
  282.     Endif
  283.     Just_drew%=1
  284.   Endif
  285. Loop
  286. '
  287. Procedure Draw_lines
  288.   Deffill Cc%,2,8
  289.   Color Cc%
  290.   If Drw_type%=2
  291.     Draw Ax%,Ay%
  292.   Endif
  293.   If Drw_type%=3
  294.     Defline 1,4,0,0
  295.     Draw Ax%,Ay%-1 To Ax%,Ay%+1
  296.   Endif
  297.   If Drw_type%=4
  298.     Defline 1,6,0,0
  299.     Draw Ax%,Ay%-1 To Ax%,Ay%+3
  300.   Endif
  301.   Old_aa%=Ax%
  302.   Old_bb%=Ay%
  303.   Do
  304.     Mouse Aa%,Bb%,Cbutton%
  305.     Exit If Cbutton%=0
  306.     Exit If (Aa%<11 Or Aa%>627 Or Bb%<121 Or Bb%>389) And Drw_type%=2
  307.     Exit If (Aa%<13 Or Aa%>625 Or Bb%<122 Or Bb%>388) And Drw_type%=3
  308.     Exit If (Aa%<10 Or Aa%>624 Or Bb%<123 Or Bb%>386) And Drw_type%=4
  309.     If Aa%<631 And Aa%>7 And Bb%>119 And Bb%<391 And Drw_type%=2
  310.       Draw Aa%,Bb% To Old_aa%,Old_bb%
  311.       Old_aa%=Aa%
  312.       Old_bb%=Bb%
  313.     Endif
  314.     If Aa%>10 And Aa%<628 And Bb%>120 And Bb%<390 And Drw_type%=3
  315.       Pbox Aa%,Bb%,Aa%+1,Bb%+1
  316.       Defline 1,4,0,0
  317.       Draw Old_aa%,Old_bb% To Aa%,Bb%
  318.       Old_aa%=Aa%
  319.       Old_bb%=Bb%
  320.     Endif
  321.     If Aa%>13 And Aa%<625 And Bb%>121 And Bb%<388 And Drw_type%=4
  322.       Pbox Aa%,Bb%,Aa%+1,Bb%+1
  323.       Defline 1,6,0,0
  324.       Draw Old_aa%,Old_bb% To Aa%,Bb%
  325.       Old_aa%=Aa%
  326.       Old_bb%=Bb%
  327.     Endif
  328.   Loop
  329.   Defline 1,1,0,0
  330.   Showm
  331. Return
  332. '
  333. Procedure Change_fill_pattern
  334.   Deffill 1,2,8
  335.   Fill 108,54
  336.   @Other_sound
  337.   Inc Fstyle%
  338.   If Ftype%=2
  339.     If Fstyle%=11
  340.       Fstyle%=16
  341.     Endif
  342.     If Fstyle%=18
  343.       Fstyle%=19
  344.     Endif
  345.     If Fstyle%=25
  346.       Ftype%=3
  347.       Fstyle%=1
  348.     Else
  349.       Goto Didit
  350.     Endif
  351.   Endif
  352.   If Ftype%=3
  353.     If Fstyle%=13
  354.       Ftype%=2
  355.       Fstyle%=3
  356.     Endif
  357.   Endif
  358.   Didit:
  359.   If Cc%=0
  360.     Deffill 1,2,8
  361.   Else
  362.     Deffill 0,2,8
  363.   Endif
  364.   Pbox 116,62,198,90
  365.   Deffill Cc%,Ftype%,Fstyle%
  366.   Pbox 116,62,198,90
  367. Return
  368. '
  369. Procedure New_color
  370.   If Ax%>0 And Ax%<44 And Cc%=0
  371.     If Drw_type%=1
  372.       Put 108,54,Opt_box$(7)
  373.       Pbox 116,62,198,90
  374.       Put 114,60,Pattern$
  375.       Put 108,0,Opt_box$(2)
  376.       @Determine_draw_option
  377.       Deffill 1,2,8
  378.       Fill 109,1
  379.       @Make_mouse
  380.     Endif
  381.     Put 0,54,Clor_choice$
  382.     Cc%=1
  383.     Deffill 1,2,8
  384.     Fill 1,55
  385.   Endif
  386.   If Ax%>54 And Ax%<98 And Cc%=1
  387.     Put 0,54,Clor_choice$
  388.     Cc%=0
  389.     Deffill 1,2,8
  390.     Fill 55,55
  391.   Endif
  392.   If Old_cc%=Cc%
  393.     Goto No_change
  394.   Endif
  395.   Old_cc%=Cc%
  396.   @Other_sound
  397.   No_change:
  398. Return
  399. '
  400. Procedure Determine_draw_option
  401.   Inc Drw_type%
  402.   If Drw_type%=2
  403.     Goto Gotit
  404.   Endif
  405.   If Drw_type%=5
  406.     Drw_type%=2
  407.   Endif
  408.   Gotit:
  409.   @Drw_icon
  410. Return
  411. '
  412. Procedure Drw_icon
  413.   Dd%=1
  414.   Color Dd%
  415.   If Drw_type%<3
  416.     Defline 1,0,0,0
  417.     Draw 180,22
  418.   Endif
  419.   If Drw_type%=3
  420.     Defline 1,4,0,0
  421.     Draw 178,22 To 182,22
  422.   Endif
  423.   If Drw_type%=4
  424.     Defline 1,6,0,0
  425.     Draw 178,22 To 184,22
  426.   Endif
  427.   Defline 1,0,0,0
  428. Return
  429. '
  430. ' ******************************** DIALOGS *******************************
  431. Procedure Save_routine
  432.   @Save_alert
  433.   Deftext 0,0,0,32
  434.   Text 84,200,"Do you want to save your work?"
  435.   @Check_target
  436.   If Yes%=1
  437.     Hidem
  438.     @Save_it
  439.     Showm
  440.   Endif
  441.   @Save_alert
  442.   Deftext 0,0,0,32
  443.   Text 104,200,"Do you really want to quit?"
  444.   @Check_target
  445. Return
  446. '
  447. Procedure Save_alert
  448.   Deffill 1,2,8
  449.   Pbox 10,120,628,390
  450.   Deffill 0,2,8
  451.   Pbox 102,242,238,338
  452.   Pbox 400,242,536,338
  453.   Color 0
  454.   Box 96,236,244,344
  455.   Box 394,236,542,344
  456.   Deffill 1,2,8
  457.   Pbox 104,244,236,336
  458.   Deffill 1,2,8
  459.   Pbox 402,244,534,336
  460.   Deftext 0,0,0,32
  461.   Text 140,300,"Yes!"
  462.   Text 450,300,"No."
  463. Return
  464. '
  465. Procedure No_room
  466.   Deffill 1,2,8
  467.   Pbox 10,120,628,390
  468.   Deftext 0,0,0,32
  469.   Text 200,205," There is not"
  470.   Text 200,245,"enough room on"
  471.   Text 200,285," this disk to"
  472.   Text 194,325,"save your work!"
  473.   @Dud_sound
  474.   Pause 150
  475. Return
  476. '
  477. Procedure No_printer
  478.   Sg%=35
  479.   Deffill 1,2,8
  480.   Pbox 10,120,628,390
  481.   Deftext 0,0,0,32
  482.   Text 200-Sg%,205,"Something is wrong!"
  483.   Text 200-Sg%,245,"Is your printer on?"
  484.   Text 200-28,285,"Is it connected to"
  485.   Text 194-Sg%,325,"   your computer?"
  486.   @Dud_sound
  487.   Pause 150
  488. Return
  489. '
  490. ' ********************************** PRINT ********************************
  491. Procedure Print_it
  492.   Hidem
  493.   Deffill 1,2,8
  494.   Fill 1,1
  495.   Sget Main_screen$
  496.   @Select_sound
  497.   Pause 15
  498.   If Out?(0)=-1
  499.     Cls
  500.     Deffill 1,2,8
  501.     Pbox 0,0,639,399
  502.     Put 0,50,Pic$(Pg%)
  503.     Hardcopy
  504.     Cls
  505.   Else
  506.     @No_printer
  507.   Endif
  508.   Sput Main_screen$
  509.   Put 0,0,Opt_box$(1)
  510.   Showm
  511. Return
  512. '
  513. ' ***************************** DISK ACTIVITIES ***************************
  514. Procedure Load_it
  515.   Open "I",#1,"MDRAWIT!.DAT"
  516.   Filel%=Lof(#1)
  517.   If Filel%<>114830
  518.     Close #1
  519.     Kill "mdraw_it!.dat"
  520.     Goto Flmissing
  521.   Endif
  522.   For I%=1 To 5
  523.     Get 0,112,638,398,Pic$(I%)
  524.   Next I%
  525.   For I%=1 To 5
  526.     Bget #1,Varptr(Pic$(I%)),Len(Pic$(I%))
  527.     Put 0,112,Pic$(I%)
  528.     @Select_sound
  529.     Pause 30
  530.   Next I%
  531.   Close #1
  532.   Flmissing:
  533. Return
  534. '
  535. Procedure Save_it
  536.   If Exist("MDRAWIT!.DAT")
  537.     Dd%=1
  538.   Else
  539.     Dd%=0
  540.     If Dfree(0)>114830
  541.       Dd%=1
  542.     Endif
  543.   Endif
  544.   If Dd%=1
  545.     Deffill 1,2,8
  546.     Pbox 10,120,628,390
  547.     Deftext 0,0,0,32
  548.     Text 250,260,"Saving..."
  549.     Open "o",#1,"MDRAWIT!.DAT"
  550.     For I%=1 To 5
  551.       Bput #1,Varptr(Pic$(I%)),Len(Pic$(I%))
  552.     Next I%
  553.     Close #1
  554.   Endif
  555.   If Dd%=0
  556.     @No_room
  557.   Endif
  558. Return
  559. '
  560. ' ********************************* SCREENS *******************************
  561. Procedure Make_main_screen
  562.   ' *** draw the easel
  563.   Deffill 1,2,8
  564.   Pbox 0,112,638,398
  565.   Deffill 0,2,8
  566.   Pbox 4,116,634,394
  567.   Deffill 1,2,8
  568.   Pbox 10,120,628,390
  569.   ' *** draw the color choices
  570.   Restore Clor_choice_data
  571.   For I%=1 To 2
  572.     Read Lx%,C%
  573.     Color 1
  574.     Box Lx%*2,54,(Lx%+22)*2,98
  575.     Box (Lx%+3)*2,60,(Lx%+19)*2,92
  576.     If C%=1
  577.       Deffill 1,2,8
  578.       Pbox (Lx%+4)*2,62,(Lx%+18)*2,90
  579.     Endif
  580.   Next I%
  581.   Get 0,54,98,98,Clor_choice$
  582.   Box 108,54,206,98
  583.   Box 114,60,200,92
  584.   Get 108,54,206,98,Opt_box$(7)
  585.   ' *** text in option boxes
  586.   Deftext 1,0,0,13
  587.   Text 117+Gg%,28,"DRAW"
  588.   Text 232+Gg%,28,"UNDO"
  589.   Text 332+Gg%,28,"BLANK"
  590.   Text 445+Gg%,28,"PIC"
  591.   Text 557+Gg%,28,"EXIT"
  592.   Text 13+Gg%,28,"PRINT"
  593.   ' *** draw the option boxes
  594.   Lx%=0
  595.   For I%=1 To 6
  596.     Color 1
  597.     Box Lx%*2,0,(Lx%+49)*2,44
  598.     Box (Lx%+3)*2,6,(Lx%+46)*2,38
  599.     Get Lx%*2,0,(Lx%+49)*2,44,Opt_box$(I%)
  600.     Add Lx%,54
  601.   Next I%
  602.   If Not Exist("MDRAWIT!.DAT")
  603.     For I%=1 To 5
  604.       Get 0,112,638,398,Pic$(I%)
  605.     Next I%
  606.   Endif
  607. Return
  608. '
  609. Procedure Title
  610.   G%=125
  611.   Sg%=75
  612.   Deftext 1,1,0,32
  613.   Text 192,40,"D R A W   I T !"
  614.   Deftext 1,1,0,13
  615.   Text 70+G%,70,"  A Graphics Design Program"
  616.   Text 66+G%,90,"      for Young Children"
  617.   If Exist("MDRAWIT!.DAT")
  618.     @Load_it
  619.     Pause 50
  620.   Endif
  621.   Deffill 0,2,8
  622.   Pbox 0,112,638,398
  623.   Ss%=80
  624.   Deftext 1,1,0,6
  625.   Text 90+Sg%,70+Ss%,"YET ANOTHER KIDPRG  IN GFA BASIC FROM"
  626.   Deftext 1,0,0,6
  627.   Text 310,70+Ss%,Chr$(191)
  628.   Deftext 1,0,0,13
  629.   Text 60+G%,90+Ss%,"         D.A. Brumleve"
  630.   Deftext 1,5,0,6
  631.   Text 109+Sg%,108+Ss%,"                      ST-LOG"
  632.   Deftext 1,1,0,6
  633.   Text 109+Sg%,108+Ss%,"    COPYRIGHT 1989 BY"
  634.   Deftext 1,1,0,6
  635.   Text 102+Sg%,126+Ss%,"      MONOCHROME VERSION 1.7"
  636.   Ss%=40
  637.   Deftext 1,1,0,13
  638.   Text 45+G%,230+Ss%,"As published originally in        !"
  639.   Sty%=92+Ss%
  640.   Stx%=-12
  641.   Color 1
  642.   Box 408+Stx%,104+Sty%,448+Stx%,146+Sty%
  643.   Color 0
  644.   Box 410+Stx%,106+Sty%,446+Stx%,144+Sty%
  645.   Deffill 0,2,8
  646.   Pbox 410+Stx%,132+Sty%,446+Stx%,144+Sty%
  647.   Deffill 1,2,8
  648.   Pbox 412+Stx%,108+Sty%,444+Stx%,130+Sty%
  649.   Deftext 0,1,0,32
  650.   Text 414+Stx%,130+Sty%," T"
  651.   Text 410+Stx%,130+Sty%,"S"
  652.   Deftext 1,1,0,6
  653.   Text 410+Stx%+11,142+Sty%,"  G"
  654.   Text 410+Stx%+6,142+Sty%," O"
  655.   Text 411+Stx%,142+Sty%,"L"
  656.   Deffill 1,2,8
  657.   Pbox 0,300,638,398
  658.   Deffill 0,2,8
  659.   Pbox 4,304,634,394
  660.   Deffill 1,2,8
  661.   Pbox 8,308,630,390
  662.   Deftext 0,1,0,13
  663.   Text 75+G%,354,"Press mouse button to begin."
  664.   @Let_go
  665.   Repeat
  666.   Until Mousek
  667. Return
  668. '
  669. ' *************************** WATCH THE MOUSE *************************
  670. Procedure Let_go
  671.   Repeat
  672.     Mouse Mx%,My%,Mk%
  673.   Until Mk%=0
  674. Return
  675. '
  676. Procedure Check_target
  677.   @Let_go
  678.   Repeat
  679.     Mouse Aa%,Bb%,Cbutton%
  680.   Until Cbutton%>0 And Bb%>240 And Bb%<340 And ((Aa%>398 And Aa%<538) Or (Aa%>100 And Aa%<240))
  681.   Deffill 0,2,8
  682.   If Aa%>398 And Aa%<538
  683.     Yes%=0
  684.     Fill 396,238
  685.   Else
  686.     Yes%=1
  687.     Fill 98,238
  688.   Endif
  689.   @Alert_sound
  690.   Pause 25
  691. Return
  692. '
  693. Procedure Make_mouse
  694.   If Drw_type%=1
  695.     @Make_brush
  696.     Defmouse Brush$
  697.   Else
  698.     @Make_crayon
  699.     Defmouse Crayon$
  700.   Endif
  701. Return
  702. '
  703. Procedure Make_crayon
  704.   Restore Ms_data
  705.   Let Crayon$=Mki$(0)+Mki$(0)
  706.   Let Crayon$=Crayon$+Mki$(0)
  707.   Let Crayon$=Crayon$+Mki$(0)
  708.   Let Crayon$=Crayon$+Mki$(1)
  709.   For I%=1 To 16
  710.     Read Backgrnd%
  711.     Let Crayon$=Crayon$+Mki$(Backgrnd%)
  712.   Next I%
  713.   For I%=1 To 16
  714.     Read Foregrnd%
  715.     Let Crayon$=Crayon$+Mki$(Foregrnd%)
  716.   Next I%
  717. Return
  718. '
  719. Procedure Make_brush
  720.   Restore Brush_data
  721.   Let Brush$=Mki$(0)+Mki$(0)
  722.   Let Brush$=Brush$+Mki$(0)
  723.   Let Brush$=Brush$+Mki$(1)
  724.   Let Brush$=Brush$+Mki$(0)
  725.   For I%=1 To 16
  726.     Read Backgrnd%
  727.     Let Brush$=Brush$+Mki$(Backgrnd%)
  728.   Next I%
  729.   For I%=1 To 16
  730.     Read Foregrnd%
  731.     Let Brush$=Brush$+Mki$(Foregrnd%)
  732.   Next I%
  733. Return
  734. '
  735. ' **************************** COLOR PALETTE **************************
  736. Procedure Check_rez
  737.   Rez%=Xbios(4)
  738.   If Rez%<>2
  739.     Alrt$=" |This version of DRAW IT!|requires High Resolution."
  740.     Alert 3,Alrt$,1,"Oops!",Dummy%
  741.     End
  742.   Endif
  743. Return
  744. '
  745. Procedure Save_palette
  746.   For I%=0 To 1
  747.     Palette%(I%)=Xbios(7,W:I%,W:-1)
  748.   Next I%
  749. Return
  750. '
  751. Procedure Restore_palette
  752.   For I%=0 To 1
  753.     Setcolor I%,Palette%(I%)
  754.   Next I%
  755. Return
  756. '
  757. Procedure Set_color
  758.   Setcolor 0,0
  759.   Setcolor 1,0
  760. Return
  761. '
  762. ' ******************************* SOUNDS *********************************
  763. Procedure Select_sound
  764.   Sound 1,15,6,3,2
  765.   Sound 1,15,6,4,2
  766.   Sound 1,15,8,4,6
  767.   Sound 1,0,0,0,0
  768. Return
  769. '
  770. Procedure Other_sound
  771.   Sound 1,15,6,4,2
  772.   Sound 1,15,1,4,5
  773.   Sound 1,0,0,0,0
  774. Return
  775. '
  776. Procedure Finale_sound
  777.   Restore Finale_data
  778.   Read N%
  779.   For I%=1 To N%
  780.     Read Nt%,Oct%,Dur%
  781.     Sound 1,15,Nt%,Oct%,Dur%
  782.     Sound 1,0,0,0,0
  783.     Pause 5
  784.   Next I%
  785. Return
  786. '
  787. Procedure Erase_sound
  788.   For Oct%=6 Downto 3
  789.     For Nt%=12 Downto 1
  790.       Sound 1,15,Nt%,Oct%,3
  791.     Next Nt%
  792.   Next Oct%
  793.   Sound 1,0,0,0,0
  794. Return
  795. '
  796. Procedure Dud_sound
  797.   For Oct%=4 Downto 1
  798.     For Nt%=12 Downto 1
  799.       Sound 1,15,Nt%,Oct%,2
  800.     Next Nt%
  801.   Next Oct%
  802.   Sound 1,0,0,0,0
  803. Return
  804. '
  805. Procedure Alert_sound
  806.   Sound 1,15,10,3,2
  807.   Sound 1,0,0,0,0
  808. Return
  809. '
  810. ' ******************************* DATA *******************************
  811. Ms_data:
  812. Data 28672,18432,19456,29184,28928,14464,7488,3744,1872,904,452,230,121,57,31,14
  813. Data 0,12288,12288,3072,3584,1792,640,320,160,112,56,24,6,6,0,0
  814. '
  815. Brush_data:
  816. Data 0,26624,13312,23552,10240,0,768,384,192,96,48,24,12,6,0,0
  817. Data 63488,37888,51712,41472,55040,32640,7360,3680,1840,920,460,230,115,57,31,15
  818. '
  819. Finale_data:
  820. Data 7
  821. Data 6,4,16
  822. Data 1,4,8
  823. Data 1,4,8
  824. Data 3,4,16
  825. Data 1,4,32
  826. Data 5,4,16
  827. Data 6,4,64
  828. '
  829. Clor_choice_data:
  830. Data 0,1
  831. Data 27,0
  832. '
  833.